package com.yu.rpc.core.config;

import com.yu.rpc.core.fault.retry.RetryStrategyKeys;
import com.yu.rpc.core.fault.tolerant.TolerantStrategyKeys;
import com.yu.rpc.core.loadbalancer.LoadBalancerKeys;
import com.yu.rpc.core.serializer.SerializerKeys;
import lombok.Data;

/**
 * RPC 框架配置
 */
@Data
public class RpcConfig {

    /**
     * 名称
     */
    private String name = "yu-rpc";

    /**
     * 版本号
     */
    private String version = "1.0";

    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";

    /**
     * 服务器端口号
     */
    private Integer serverPort = 8082;

    /**
     * 是否模拟数据
     */
    private boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;

    private RegistryConfig registryConfig = new RegistryConfig();

    private String loadBalancer = LoadBalancerKeys.CONSISTENT_HASH;

    private String retryStrategy = RetryStrategyKeys.FIXED_INTERVAL;

    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;

}
